package sg.edu.nus.iss.vmcs.termination.states;

import sg.edu.nus.iss.vmcs.customer.CoinReceiver;
import sg.edu.nus.iss.vmcs.system.DispenseController;
import sg.edu.nus.iss.vmcs.system.TransactionController;
import sg.edu.nus.iss.vmcs.termination.template.Termination;

/**
 * Author : Priyanka
 * the main state parent Class 
 * 
 * lifecycle of customer panel:
 * insert coin
 * selectDrink
 * dispenseDrink
 * dispenseChange
 * 
 * */


public abstract class TerminateState {
	
	TransactionController tc;
	
	
	public void handleTermination(DispenseController dc,CoinReceiver coinRec)
	{
		Termination terminate=new Termination() {
				
				@Override
				protected void CallUseCase() {
					System.out.println("Template Method : Termination on "+getStateName());
					
				}
			};
		terminate.terminate(dc);
		
	}
		
	protected  String getStateName()
	{
		return "Initial State";
	}
	
	
	public void nextState(TransactionController tc){		
		tc.setCurrentState(new InitialState());
		
	}

	
}

